<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.*" %>
<%@ page import="java.net.URL" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String openURL =  request.getAttribute("wjlj")==null?"":request.getAttribute("wjlj").toString();
%>

<%
    out.clear();
    out = pageContext.pushBody();
    response.setContentType("application/pdf");

    try {
        URL url = new URL(openURL);
        //如果需要通过防火墙，要考虑URL   链接
        BufferedInputStream   bis   =   new   BufferedInputStream(url.openStream());
        //完成上述操作，就只要简单地将   InputStream   中的字节，写入到   servlet   的输出流   OutputStream   中：
        BufferedOutputStream   bos   =   new BufferedOutputStream(response.getOutputStream());
        byte[]   buff   = new byte[2048];
        int bytesRead;
//     Simple   read/write   loop.
        while(-1   !=  (bytesRead = bis.read(buff,0,buff.length))){
            bos.write(buff,   0,   bytesRead);
        }

    } catch (Exception e) {
        out.println(e.getMessage());
    }
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <meta http-equiv="Content-Script-Type" content="text/javascript" />
        <meta http-equiv="pragma" content="no-cache"/>

        <title>${tCollectorData.title}</title>
    </head>
    <body>

	</body>
</html>

